package chapter_9;

public class Test3 {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
          @Override
          public void run(){
              try {
                  Thread.sleep(500);
              } catch (InterruptedException e) {
                  throw new RuntimeException(e);
              }
              System.out.println("thread  1  ");
          }
        };
        Thread t2 = new Thread(){
            @Override
            public void run(){
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                System.out.println("thread  2  ");
            }
        };
        t1.setPriority(1);
        t2.setPriority(10);
        t1.start();
        t2.start();
        System.out.println(t1.getPriority());
        System.out.println(t2.getPriority());
    }
}
